package com.mytijian.task.zookeeper.listener.manager;

import com.mytijian.task.zookeeper.LeaderService;
import com.mytijian.task.zookeeper.ZookeeperRegistryCenter;
import com.mytijian.task.zookeeper.listener.AbstractDataChangeListener;

public abstract class AbstractListenerManager {
    protected ZookeeperRegistryCenter zookeeperRegistryCenter;
    protected LeaderService leaderService;

    public AbstractListenerManager(ZookeeperRegistryCenter zookeeperRegistryCenter, LeaderService leaderService) {
        this.zookeeperRegistryCenter = zookeeperRegistryCenter;
        this.leaderService = leaderService;
    }
    public abstract void start();
    protected void addListener(String path, AbstractDataChangeListener listener) {
        zookeeperRegistryCenter.addListener(path, listener);
    }
}
